﻿
function HomeViewModel() {
    // Data
    var self = this;
    self.dataSource = upshot.dataSources.GetCatalogs;
    self.localDataSource = upshot.LocalDataSource({ source: self.dataSource });
   // self.localDataSource = upshot.LocalDataSource({ source: self.dataSource, autoRefresh: true, allowRefreshWithEdits: true });
    self.Catalogs = self.localDataSource.getEntities();
    //self.deliveriesForCustomer = self.deliveries.groupBy("Customer");
   // self = ko.observable(false);

    // Operations
   // self.saveAll = function () { self.dataSource.commitChanges() }
   // self.revertAll = function () { self.dataSource.revertChanges() }

   // self.excludeDelivered.subscribe(function (shouldExcludeDelivered) {
     //   var filterRule = shouldExcludeDelivered ? { property: "IsDelivered", operation: "==", value: false }
                                            //    : null;
       // self.localDataSource.setFilter(filterRule);
        //self.localDataSource.refresh();
    //});
}